using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_AllPhysBal__Map : EntityTypeConfiguration<so_AllPhysBal__>
    {
        public so_AllPhysBal__Map()
        {
            // Primary Key
            this.HasKey(t => new { t.sumfields, t.dimfields });

            // Properties
            this.Property(t => t.Physician__)
                .HasMaxLength(8);

            this.Property(t => t.Physician)
                .HasMaxLength(35);

            this.Property(t => t.account__)
                .HasMaxLength(40);

            this.Property(t => t.currency)
                .HasMaxLength(5);

            this.Property(t => t.sumfields)
                .IsRequired()
                .HasMaxLength(15);

            this.Property(t => t.dimfields)
                .IsRequired()
                .HasMaxLength(13);

            // Table & Column Mappings
            this.ToTable("so_AllPhysBal__");
            this.Property(t => t.Physician__).HasColumnName("Physician_#");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.account__).HasColumnName("account_#");
            this.Property(t => t.currency).HasColumnName("currency");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.BASE_1).HasColumnName("BASE_1");
            this.Property(t => t.BASE_2).HasColumnName("BASE_2");
            this.Property(t => t.sumfields).HasColumnName("sumfields");
            this.Property(t => t.dimfields).HasColumnName("dimfields");
        }
    }
}
